window: Be more careful when looking for focus
authorMatthias Clasen <mclasen@redhat.com>
Fri, 9 Oct 2020 00:32:39 +0000 (20:32 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 14 Oct 2020 19:05:46 +0000 (15:05 -0400)
When passing focus up to a parent, make sure the
newly chosen focus widget actually accepts the focus.

gtk/gtkwindow.c

index c5c69e2b333e39366eec86e761f126194a084884..a6f7f37912db94b191d9c53225a0eeeecd143d9c 100644 (file)
@@ -5242,8 +5242,8 @@ _gtk_window_unset_focus_and_default (GtkWindow *window,
         {
           if (_gtk_widget_get_visible (parent))
             {
-              gtk_window_set_focus (window, parent);
-              break;
+              if (gtk_widget_grab_focus (parent))
+                break;
             }
 
           parent = gtk_widget_get_parent (parent);